package com.FangFaYingYong.A01FangFaYingYong;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

public class Test03 {
    public static void main(String[] args) {
        /*
        * 创建集合添加学生对象
        * 把姓名拼接成：张三-23 并放到数组中
        * */
        ArrayList<C04_Student> list = new ArrayList<>();
        Collections.addAll(list,new C04_Student("张三",23),new C04_Student("李四",24),new C04_Student("王五",25));

        String[] array = list.stream().map(C04_Student::montage).toArray(String[]::new);
        System.out.println(Arrays.toString(array));
    }
}
